﻿namespace Sidvall.AuthorizationManager.Net.Services.V1
{
    public partial class ServerConnection
    {
        #region Public Members

        #region Deserialize

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
        public static ServerConnection Deserialize(string value)
        {
            ServerConnection item;

            if (string.IsNullOrWhiteSpace(value))
                return null;
            try
            {
                item = Sidvall.Serialization.SerializerManager.Current.Deserialize<ServerConnection>(value);
            }
            catch
            {
                item = null;
            }
            return item;
        }

        #endregion
        #region Serialize

        public string Serialize()
        {
            return Serialize(this);
        }
        public static string Serialize(ServerConnection context)
        {
            return Sidvall.Serialization.SerializerManager.Current.SerializeObject(context);
        }

        #endregion

        #endregion
    }
}